<?php
class TypeEntite{
	private $id;
	private $label;
	private $tooltip;
	private $is_default;
	private $proprietes;

	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	function getId(){
		return $this->id;
	}
	public function setLabel($labelstr){
		$this->label = $labelstr;
	}
	public function setTooltip($tooltipstr){
		
		$this->tooltip = $tooltipstr;
	}
	public function getLabel(){
		return $this->label;
	}
	public function getTooltip(){
		return $this->tooltip;
	}
	public function getProprietes(){
		return $this->proprietes;
	}
	public function setProprietes($probTab){

		if(is_array($probTab)){
			 
			$bool = true;
			foreach ($probTab as $Prop){

				if (!is_a($Prop, "Propriete")){
					 
					var_dump($Prop);
					$bool = false;
				}
			}
			if($bool){
				$this->proprietes = $probTab;
			}else{

				throw new FieldFormatException($_SESSION['translator']->listEx." Propriete");
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->arrayErr);
		}
	}
	
	function isDefault(){
		return $this->is_default;
	}
	
	function setDefault($bool){
		if($bool==1 || $bool == 0){
			$this->is_default = $bool;
		}else{
			throw new FieldFormatException($_SESSION['translator']->boolErr);
		}
	}
}
?>